#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

string s;
char a[100][100];

int main()
{
	//freopen("490.in", "r", stdin);

	for (int i = 0; i < 100; i++)
		for (int j = 0; j < 100; j++) a[i][j] = ' ';

	int ii = 0, jj = 0;

	while (getline(cin, s))
	{
		if (ii < s.size()) ii = s.size();
		for (int i = 0; i < s.size(); i++) a[i][jj] = s[i];
		jj++;
	}

	for (int i = 0; i < ii; i++)
	{
		for (int j = jj-1; j >= 0; j--) cout << a[i][j];
		cout << endl;
	}

	return 0;
}
